Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle holding records that have neither a chronology nor enumeration #1016

Merged
merged 1 commit into from
Jul 26, 2023

Conversation

jcoyne
Copy link
Contributor

@jcoyne jcoyne commented Jul 26, 2023

Fixes #1013

@@ -84,7 +84,7 @@ def latest_received(holding_id)
return unless latest_piece && order_is_ongoing_and_open?(latest_piece)

enumeration = latest_piece['enumeration'] # may not be present
chronology = latest_piece.fetch('chronology')
chronology = latest_piece['chronology'] # may not be present
enumeration ? "#{enumeration} (#{chronology})" : chronology
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to tweak the string output in that case?

Suggested change
enumeration ? "#{enumeration} (#{chronology})" : chronology
enumeration && chronology ? "#{enumeration} (#{chronology})" : enumeration || chronology

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It currently looks to have parity with what is coming out of Symphony, so I see no reason to make adjustments there.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised we'd leave a blank () sitting around if there was an enumeration but not a chronology, but it's difficult to deciphering the existing logic and/or translate the MHLD fields to FOLIO data.

Is this the equivalent code?
https://github.com/sul-dlss/searchworks_traject_indexer/blob/main/lib/mhld_field.rb#L57-L62

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. This was just to fix the missing method error. If you think there's an error in the output, I would prefer that we make that a new issue, find an example record and add a test to show the behavior we want.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤷‍♂️

@cbeer cbeer merged commit d9e1941 into main Jul 26, 2023
2 checks passed
@cbeer cbeer deleted the missing-chronology branch July 26, 2023 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[searchworks_traject_indexer/stage] KeyError: key not found: "chronology"
2 participants